# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.CloudChannel.V1.Model.GoogleCloudChannelV1RenewalSettings do
  @moduledoc """
  Renewal settings for renewable Offers.

  ## Attributes

  *   `enableRenewal` (*type:* `boolean()`, *default:* `nil`) - If false, the plan will be completed at the end date.
  *   `paymentCycle` (*type:* `GoogleApi.CloudChannel.V1.Model.GoogleCloudChannelV1Period.t`, *default:* `nil`) - Describes how frequently the reseller will be billed, such as once per month.
  *   `paymentPlan` (*type:* `String.t`, *default:* `nil`) - Describes how a reseller will be billed.
  *   `resizeUnitCount` (*type:* `boolean()`, *default:* `nil`) - If true and enable_renewal = true, the unit (for example seats or licenses) will be set to the number of active units at renewal time.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :enableRenewal => boolean() | nil,
          :paymentCycle => GoogleApi.CloudChannel.V1.Model.GoogleCloudChannelV1Period.t() | nil,
          :paymentPlan => String.t() | nil,
          :resizeUnitCount => boolean() | nil
        }

  field(:enableRenewal)
  field(:paymentCycle, as: GoogleApi.CloudChannel.V1.Model.GoogleCloudChannelV1Period)
  field(:paymentPlan)
  field(:resizeUnitCount)
end

defimpl Poison.Decoder, for: GoogleApi.CloudChannel.V1.Model.GoogleCloudChannelV1RenewalSettings do
  def decode(value, options) do
    GoogleApi.CloudChannel.V1.Model.GoogleCloudChannelV1RenewalSettings.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.CloudChannel.V1.Model.GoogleCloudChannelV1RenewalSettings do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
